import VueRouter from 'vue-router'
// 路由切换:组件是注册在挂载具体路由文件内的
import About from '../pages/About.vue'
import Home from '../pages/Home.vue'
import News from '../pages/News.vue'
import Message from '../pages/Message.vue'

export default new VueRouter({
    // 易出错的配置变量名routers
    routes: [
        {
            path: '/about',
            component: About,
        },
        {
            path: '/Home',
            component: Home,
            children: [
                {
                    // 嵌套路由路径无需/
                    path: 'news',
                    component: News
                },
                {
                    path: 'message',
                    component: Message
                }
            ]
        }
    ]
})